package 代码记录.指定公司代码练习记录.西安.分值100分;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * @author zx
 * @create 2023-07-09 16:02
 * 三数之和变种，我自己做的(再看看,不就三数之和变种嘛)
 */
public class 勾股数元组 {//101--看下就好
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        List<List<Integer>> res = new ArrayList<>();
        for(int i = n;i <= m;i++){
            for(int j = i + 1;j <= m;j++){
                for(int k = j + 1;k <= m;k++){
                    if((i * i + j * j == k * k) && isOK(i,j) && isOK(i,k) && isOK(j,k)){
                        List<Integer> temp = new ArrayList<>();
                        temp.add(i);
                        temp.add(j);
                        temp.add(k);
                        res.add(new ArrayList<>(temp));
                    }
                }
            }
        }
        for(List<Integer> list : res){
            for(int k = 0;k < list.size();k++){
                System.out.print(list.get(k) + " ");
            }
            System.out.println();
        }
    }


    /**
     * @return 判断两数是否互质
     */
    private static boolean isOK(int i, int j){
        BigInteger a = new BigInteger(String.valueOf(i));
        BigInteger b = new BigInteger(String.valueOf(j));
        BigInteger gcd = a.gcd(b);
        Integer res = Integer.parseInt(gcd.toString());
        return res == 1;
    }
}
